package yz.com.javautil.dijkstrautil;

/**
 * @author Administrator
 */
public class DijkstraImplTest {

    public static void main(String[] args) {
        DijkstraImpl<Integer> directNet = new DijkstraImpl<>(5);

        directNet.addVertex(0);
        directNet.addVertex(1);
        directNet.addVertex(2);
        directNet.addVertex(3);
        directNet.addVertex(4);

        directNet.addEdge(0, 1, 1);
        directNet.addEdge(0, 2, 2);
        directNet.addEdge(0, 3, 3);
        directNet.addEdge(1, 0, 1);
        directNet.addEdge(1, 3, 1);
        directNet.addEdge(2, 0, 2);
        directNet.addEdge(3, 1, 1);
        directNet.addEdge(3, 0, 3);
        directNet.addEdge(3, 4, 1);
        directNet.addEdge(4, 3, 1);

        directNet.dijkstra(0, 4);

    }

}
